IF OBJECT_ID('dbo.vwInfoEdPreAwardManager') IS NOT NULL
BEGIN
    DROP VIEW dbo.vwInfoEdPreAwardManager
    IF OBJECT_ID('dbo.vwInfoEdPreAwardManager') IS NOT NULL
        PRINT '<<< FAILED DROPPING VIEW dbo.vwInfoEdPreAwardManager >>>'
    ELSE
        PRINT '<<< DROPPED VIEW dbo.vwInfoEdPreAwardManager >>>'
END
go
-- =======================================================================
-- Object Name: (VIEW) dbo.vwInfoEdPreAwardManager
--
-- Author:      Kevin Cashman, Parallax Consulting LLC
--
-- Create date: 9/??/2007 
--
-- Description: View to PreAwardManagers.
--
-- Used BY Procedure/Report: dbo.RptPopulateAgreementInfoTable
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 9/??/07     KC        Created
-- 9/20/07     KC        Changed source of login-id
-- 9/28/07     KC        Fixed FwkDomainUserId
--
-- =======================================================================
CREATE VIEW dbo.vwInfoEdPreAwardManager
AS
      SELECT DISTINCT P.Id AS PersonId,
                P.LastName + ', ' + P.FirstName as ManagerName,
                UDF.PreAwardManager
      FROM dbo.InfoEdUDFProposal UDF
               INNER JOIN dbo.FwkDomainUser U ON UPPER(RTRIM(UDF.PreAwardManager)) = UPPER(RTRIM(U.UserName))
               INNER JOIN dbo.AdmPerson P ON U.Id = P.FwkDomainUserId
go
IF OBJECT_ID('dbo.vwInfoEdPreAwardManager') IS NOT NULL
    PRINT '<<< CREATED VIEW dbo.vwInfoEdPreAwardManager >>>'
ELSE
    PRINT '<<< FAILED CREATING VIEW dbo.vwInfoEdPreAwardManager >>>'
go
